package com.hp.siminterface.webservice.impl;

import java.util.List;

import com.hp.siminterface.domain.CPU;
import com.hp.siminterface.persistence.CPUMapper;
import com.hp.siminterface.webservice.CPUService;

public class CPUServiceImpl implements CPUService {
	private CPUMapper cpuMapper;

	@Override
	public CPU[] getCPUInfo() {
		List<CPU> cpus = cpuMapper.selectCPU();
		CPU[] cpuArray = new CPU[cpus.size()];
		int i = 0;
		for (CPU cpu : cpus) {
			cpuArray[i] = cpu;
			i++;
		}
		return cpuArray;
	}

	public void setCpuMapper(CPUMapper cpuMapper) {
		this.cpuMapper = cpuMapper;
	}

}
